import { CODE_URL, USER_LOGIN_URL, USER_REGISTER_URL } from "../config/urls.cfg";
import request from "./ajax";

/** 获取验证码接口 */
export function getCodeApi(phone: string) {
    return request({
        url: CODE_URL,
        params: { phone }
    })
}

/** 获取用户注册接口 */
export function userRegisterApi(data: any) {
    return request({
        url: USER_REGISTER_URL,
        method: 'PUT',
        data
    })
}

/** 获取用户登录接口 */
export function userLoginApi(phone: string, code: string) {
    return request({
        url: USER_LOGIN_URL,
        method: 'POST',
        data: {phone, code}
    })
}